package com.example.socialwebserver.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.socialwebserver.mapper.ExpectLoveMapper;
import com.example.socialwebserver.pojo.ExpectLoveDAO;
import com.example.socialwebserver.service.ExpectLoveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ExceptLoveServiceImpl implements ExpectLoveService {
    @Autowired
    ExpectLoveMapper expectLoveMapper;
    @Override
    public ExpectLoveDAO SelectById(Integer id) {
        return expectLoveMapper.selectById(id);
    }
    @Override
    public boolean InsertExLoDAO(ExpectLoveDAO expectLoveDAO) {
        return expectLoveMapper.insert(expectLoveDAO) == 1?true:false;
    }
    @Override
    public boolean UpdateById(ExpectLoveDAO expectLoveDAO) {
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("id", expectLoveDAO.getId());
        return expectLoveMapper.update(expectLoveDAO,queryWrapper) == 1?true:false;
    }
    @Override
    public boolean DeleteById(Integer id) {
        return expectLoveMapper.deleteById(id) == 1?true:false;
    }
}
